require('babel-register')
var config = require('../../config')

// http://nightwatchjs.org/gettingstarted#settings-file
module.exports = {
  src_folders: ['test/e2e/specs'], //测试文件的存放目录
  output_folder: 'test/e2e/reports', //测试报表存放路径
  custom_assertions_path: ['test/e2e/custom-assertions'], //自定义断言文件存放路径
//custom_commands_path: '', //自定义命令文件存放路径
//page_objects_path: '', //页面对象文件存放路径
//globals_path: '', //全局模块配置文件目录

  selenium: { //selenium 服务器运行配置
    start_process: true, //配置是否自动管理selenium进程
    server_path: require('selenium-server').path, //指定selenium jar 运行文件目录
    host: '127.0.0.1',
    port: 4444,
    cli_args: { //selenium命令行参数列表
      'webdriver.chrome.driver': require('chromedriver').path
    }
  },

  test_settings: { //测试配置
    default: {
      selenium_port: 4444,
      selenium_host: 'localhost',
      silent: true, //是否显示扩展的selenium命令日志
      globals: { //配置测试环境使用的全局变量或者全局配置项
        devServerURL: 'http://localhost:' + (process.env.PORT || config.dev.port)
      }
    },

    chrome: {
      desiredCapabilities: {
        browserName: 'chrome',
        javascriptEnabled: true,
        acceptSslCerts: true
      }
    },

    firefox: {
      desiredCapabilities: {
        browserName: 'firefox',
        javascriptEnabled: true,
        acceptSslCerts: true
      }
    }
  }
}
